			
            <div id="title-bar">
                <div id="element-count">
                    <div id="info-element">
                        <div class="number"><?php echo $countpost;?></div>
                        <span>bài viết</span>
                    </div>
                    <div id="img-element">
                    	<div class="nav-icons ico-post"></div>
                    </div>
                </div>
                <h2 id="title-page">Quản lý bài viết (<?php echo $typepost->Name_vn?>) <a class="label" href="<?php echo base_url('administrator/post/add')?>">+ thêm bài viết</a></h2>
            </div>
            <div class="row-fluid">
            	<?php if(isset($textkeysearch)):?>
                
                <h4>
                	CÓ <?php echo ($listposts)?count($listposts):0;?> KẾT QUẢ ĐƯỢC TÌM KIẾM TỪ "<em><?php echo $textkeysearch?></em>"
                    <a href="" onClick="parent.location='';return false;"><i class="icon-remove-sign"></i></a>
                </h4>
                <?php endif;?>
                
            </div>
            <div class="row-fluid">
            	<div class="span8">
                	<?php echo form_open('administrator/post/manager','method="get" name="form_type_post"')?>
      
                    <div class="input-group filter-group">
                        <span class="input-group-addon"><i class="icon-filter"></i></span>
                        <select name="tpid" onChange="document.form_type_post.submit()">
                        <?php foreach($listtypepost as $row){?>
                            
                            <option value="<?php echo $row->TpId ?>" <?php echo ($row->TpId==$typepost->TpId)?"selected='selected'":"" ?>><?php echo $row->Name_vn ?></option>
                        <?php }?>
                        
                    	</select>
                    </div>
                    <?php echo form_close()?>
                </div>
            	<div class="span4">
                	<div class="pull-right">
                        <?php echo form_open('administrator/post/manager?tpid='.$typepost->TpId, 'id="formSearch" class="form-inline"') ?>
                        
                        	<div class="input-append">
                            	<input type="text" value="<?php echo set_value('keysearch')?>" name="keysearch" id="keysearch" placeholder="Nhập từ khóa" class="input-medium" autocomplete="off" />
                                <select id="field-search" name="field_search">
                                	<option value="1" <?php echo set_select('field_search',1)?>>Tiêu đề</option>
                                    <option value="2" <?php echo set_select('field_search',2)?>>Người đăng</option>
                                </select>
                                <button class="btn">
                                	<i class="icon-search"></i>
                                </button>
                            </div>
                        <?php echo form_close() ?>
                        
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
 
                <table class="table table-striped table-bordered genaral-tables" width="100%">
                	<thead>
                    	<tr>
                        	<th width="3%">#</th>
                            <th width="35%">Tiêu đề</th>
                            <th width="10%">Hình ảnh</th>
                            <th width="7%">Lượt xem</th>
                            <th width="14%">Người đăng</th>
                            <th width="8%">Ngày viết</th>
                            <th width="12%">Trạng thái</th>
                            <th width="11%">Hành động</th>
                        </tr>
                    </thead>
                    <tbody>
                    	<?php if($listposts): foreach($listposts as $row){?>
                        
                        <tr rel="<?php echo $row->PostId ?>" id="table_row_<?php echo $row->PostId?>">
                            <td class="text-center"><?php echo $row->stt ?></td>
                            <td>
                            	<a href=""><?php echo $row->Title_vn ?></a>
                            </td>
                            <td class="text-center image"><img src="<?php echo base_url($row->Image); ?>" alt="" /></td>
                            <td class="text-center"><?php echo $row->Viewed; ?></td>
                            <td class="text-center"><?php echo $row->FullName; ?></td>
                            <td class="text-center"><?php echo $row->CreateDate; ?></td>
                            <td class="text-center status"><small><?php if($row->Status==1){echo "<span class='label label-success'>Hoạt động</span>";}elseif($row->Status==2){echo "<span class='label'>Không hoạt động</span>";} ?></small></td>
                            <td class="table-col-action text-center">
                                <a class="btn-change-status" rel="tooltip" href="" title="Đổi trạng thái" status="<?php echo $row->Status?>">
                                	<i class="<?php echo ($row->Status==1)?'icon-ok-sign':(($row->Status==2)?'icon-remove-sign':'');?>"></i>
                                </a>
                                <a rel="tooltip" href="<?php echo base_url('administrator/post/modify?postid='.$row->PostId) ?>" title="Sửa mục">
                                	<i class="icon-pencil"></i>
                                </a>
                                <a class="btn-delete" rel="tooltip" href="" title="Xóa mục" >
                                	<i class="icon-remove"></i>
                                </a>
                            </td>
                        </tr>
                       
                        <?php } else: ?>
                        
                        <tr>
                            <td class="text-center" colspan="8">
                                Không có mục nào được tìm thấy
                            </td>
                        </tr>
                       	<?php endif;?>
                        
                        <tr>
                            <td class="tableFooter" colspan="8">
                                <div class="pull-left"></div>
                                <div class="pagination pull-right">
                                    <?php echo $paging ?>
                                    
                                </div>
                            </td>
                        </tr>
                    </tbody>
       			</table>
          
            